This function will return an array of effect names for the active layer. You can get the effects count from the array's length property. The effect names are Action Manager names so if you want them to match the GUI you will need to translate. i.e. stroke in action manager is frameFX
function getEffects() {
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);
if ( desc.hasKey( stringIDToTypeID( 'layerEffects' ) ) ) {
var effects = [];
var effectDesc = desc.getObjectValue( stringIDToTypeID( 'layerEffects' ) );
// first key is scale so skip and start with 1
for ( var effect = 1; effect < effectDesc.count; effect++ ) {
effects.push( typeIDToStringID( effectDesc.getKey( effect ) ) );
}
return effects;
}
}